#ifndef LONGKEY_COMMON_LANG_H_
#define LONGKEY_COMMON_LANG_H_

#include <Windows.h>
#include <atlstr.h>
#include <vector>

namespace lang
{
	CString GetDefaultLanguage(bool is_system);
	LANGID GetDefaultLanguageID(bool is_system);

	CString GetLanguageForLangID(LANGID langid);

	bool IsLanguageIDSupported(LANGID langid);
	bool IsLanguageSupported(const CString& language);
	void GetSupportedLanguages(std::vector<CString>* codes);

	// Returns requested_language if supported. Otherwise returns current user's
	// language if supported or "en" if both of them are not supported.
	CString GetLanguageForProcess(const CString& requested_language);

	// Returns the written language name for a given language. For most languages,
	// the names are exactly same. There are very few exceptions. For example, the
	// written language of zh-HK is zh-TW.
	CString GetWrittenLanguage(const CString& requested_language);

	// Returns whether a language and its corresponding supported language have
	// different names.
	bool DoesSupportedLanguageUseDifferentId(const CString& requested_language);
}

#endif	// LONGKEY_COMMON_LANG_H_